package org.teammach.laddercomp.shared;

import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(detachable="true")
public class RoundLadder {


		public RoundLadder(int round, List<String> teams) {
			//super();
			this.teams = teams;
			this.round = round;
			valid = Boolean.FALSE;
		}
		
	    @PrimaryKey
	    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	    private Key key;
		
		@Persistent
		Integer round;
		
		 @Persistent
		List<String> teams;
		 
		 @Persistent
		 Boolean valid = false;

		public Boolean getValid() {
			if(valid == null) {
				valid = Boolean.FALSE;
			}
			return valid;
		}

		public void setValid(Boolean valid) {
			this.valid = valid;
		}

		public Integer getRound() {
			return round;
		}

		public void setRound(Integer round) {
			this.round = round;
		}

		public List<String> getTeams() {
			//System.out.println("OFficial ladder has " + teams.size() + " teams");
			return teams;
		}

		public void setTeams(List<String> teams) {
			this.teams = teams;
		}
		
}


